const express = require('express')
const router = express.Router()
const authMiddleware = require('../middleware/authMiddleware') // 引入 Token 验证中间件
const CabinetControllers = require('../controllers/cabinetControllers')

router.post('/add',authMiddleware, CabinetControllers.addNewCabinet)
router.post('/del/:number',authMiddleware, CabinetControllers.delCabinetByNum)
router.put('/update/:number',authMiddleware, CabinetControllers.updateCabinetByNum)
router.get('/number/:number',authMiddleware, CabinetControllers.getCabinetByNum)
router.get('/',authMiddleware, CabinetControllers.getAllCabinets)
router.get('/grp/:grpid', CabinetControllers.getCabinetsByGrpId)
router.post('/close', CabinetControllers.closeCabinetByNum)

module.exports = router
